<?php

/**
 * 数据库配置
 */
return array(
    /* 驱动名称 */
    'driver' => 'pdomysql', //pdomysql mysqli mysql default
    /* 保存语句 */
    'saveQueries' => TRUE,
    /* 主库配置（增删改） */
    'masters' => array(
        /* mysql */
        'mysql' => array(
            'username' => 'root',
            'password' => '',
            'db' => 'yungo',
            'charset' => 'utf8',
            'host' => array(
                'localhost'
            ),
        ),
        /* mysqli */
        'mysqli' => array(
            'username' => 'root',
            'password' => '',
            'db' => 'yungo',
            'charset' => 'utf8',
            'attributes' => array(
                MYSQLI_OPT_CONNECT_TIMEOUT => 20
            ),
            'host' => array(
                'localhost'
            ),
        ),
        /* pdomysql */
        'default' => array(
            'username' => 'root',
            'password' => '',
            'attributes' => array(
                \PDO::ATTR_TIMEOUT => 20,
                \PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\''
            ),
            'dsn' => array(
                'mysql:host=localhost;port=3306;dbname=yungo'
            ),
        )
    ),
    /* 从库配置（读） */
    'slaves' => array(
        'default' => array(
            'username' => 'root',
            'password' => '',
            'attributes' => array(
                \PDO::ATTR_TIMEOUT => 20,
                \PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\''
            ),
            'dsn' => array(
                'mysql:host=localhost;port=3306;dbname=yungo'
            ),
        )
    ),
);


